package com.example.book.designmodel.责任链模式;

import java.util.Arrays;
import java.util.List;

public class MainTest {

    public static void main(String[] args) {
        //各个handler之间没有引用，并不知道下一个是谁
        List<AbstractHandler> handlerList = Arrays.asList(new HandlerB(), new HandlerC(), new HandlerA());
        Chain chain = new Chain();
        chain.setHandlerList(handlerList);
        //开始链的调用
        chain.doProcess();
    }
}
